{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Analysis of Acetonitrile to calculate the viscosity\n",
    "\n",
    "Assumes the path to PyLAT/src has been added to PYTHONPATH"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Import Classes\n",
    "\n",
    "import and initialize required classes for calculations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from calcVisc import calcVisc\n",
    "cv = calcVisc()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Define input \n",
    "input for viscosity calculations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "visc_dir = 'test_'\n",
    "visc_num = 50\n",
    "visc_skip = 10001\n",
    "visc_log = 'visc.log'\n",
    "verb = 0\n",
    "output = {}\n",
    "visc_samples = 30\n",
    "visc_num_boots = 10\n",
    "visc_plot=False\n",
    "visc_guess = [1e-3,1.5e-1,1e2,1e3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Property Calculations\n",
    "Calculation of viscosity"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "output = cv.calcvisc(visc_num,visc_skip,visc_dir,visc_log,output,verb,visc_samples,visc_num_boots,visc_plot,visc_guess)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Print Output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Viscosity: 0.554670202894 plus or minus 0.0460776871265 cP\n"
     ]
    }
   ],
   "source": [
    "print('Viscosity: {} plus or minus {} cP'.format(output[\"Viscosity\"][\"Average Value\"],output[\"Viscosity\"][\"Standard Deviation\"]))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
